package com.ctg.itrdc.sysmgr.portal.service.utils;

import org.apache.commons.lang3.StringUtils;


public class RandomCodeUtil {
	
	public final static String SYSTEM_ROLE = "R-";
	public final static String SYSTEM_USER = "U-";
	public final static String SYSTEM_POST = "P-";
	public final static String SYSTEM_STAFF = "S-";
	public final static String SYSTEM_ORG = "O-";
	

	public static String gen(String type,long id){
		String idStr = id+"";
		int i = 4 - idStr.length();
		if(i>0){
			// 补0
			idStr = StringUtils.repeat("0", i)+idStr;
		}
		return type+idStr;
	}
	
	public static void main(String[] args) {
		String result = gen(SYSTEM_ROLE,999);
		System.out.println(result);
	}
}


